package com.neusoft.controller;

import com.neusoft.dto.PiVocationsDto;
import com.neusoft.dto.PositionConditionDto;
import com.neusoft.dto.VocationDto;
import com.neusoft.dto.VocationsDto;
import com.neusoft.service.VacationService;
import com.neusoft.service.impl.VacationServiceImpl;
import com.neusoft.utils.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @AUTHOR 杜豪冰
 * @DATE 2025/1/14 14:26
 * @DESCRIBER
 */
@RestController
@RequestMapping("/api")
public class VocationController {
    @Autowired
    VacationServiceImpl vocationService;
    @PostMapping("/requestvocation")
    public ServerResponse requestVacation(@RequestBody VocationDto vocationDto){
        return vocationService.requestVacation(vocationDto);
    }

    @GetMapping("/vocations")
    public ServerResponse getPositions(VocationsDto vocationsDto){
        return vocationService.getVocations(vocationsDto);
    }

    @GetMapping("/deptvocations")
    public ServerResponse getDeptPositions(VocationsDto vocationsDto){
        return vocationService.getDeptVocations(vocationsDto);
    }
    @PostMapping("/updateVocationStatus")
    public ServerResponse updateVocationStatus(@RequestBody PiVocationsDto piVocationsDto){
        return vocationService.updateVocationStatus(piVocationsDto);
    }
}
